import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    /* 是否折叠  false(不折叠) */
    isCollapse: false,
    /* 要传给面包屑的数据 */
    pathName: window.sessionStorage.getItem('pathName') || '首页',
    /* 侧边栏激活的路径 */
    activePath: window.sessionStorage.getItem('activePath') || '/dashboard'

  },
  getters: {
  },
  mutations: {
    /* 改变isCollapse的值 */
    changeIsCollapse (state, value) {
      state.isCollapse = value
    },
    /* 修改面包屑数据 */
    changePathName (state, name) {
      state.pathName = name
    },
    /* 修改侧边栏激活的路径 */
    changeActivePath (state, path) {
      state.activePath = path
    }
  },
  actions: {
  },
  modules: {
  }
})
